package com.warrior.gathercommon.common;


public class CommonResponse {
    public static CommonResult success(Object obj){
        return new CommonResult(
                ResultCode.SUCCEED_CODE,
                ResultCode.SUCCEED_MESSAGE,
                obj,
                null
        );
    }

    public static CommonResult sucess(String msg,Object obj){
        return new CommonResult(
                ResultCode.SUCCEED_CODE,
                msg,
                obj,
                null
        );
    }

    public static CommonResult sucess(String msg,Object obj,Object ext){
        return new CommonResult(
                ResultCode.SUCCEED_CODE,
                msg,
                obj,
                ext
        );
    }

    public static CommonResult error(Object obj){
        return new CommonResult(
                ResultCode.ERROR_CODE,
                ResultCode.ERROR_MESSAGE,
                obj,
                null
        );
    }
    public static CommonResult error(String msg,Object obj){
        return new CommonResult(
                ResultCode.ERROR_CODE,
                msg,
                obj,
                null
        );
    }

    public static CommonResult error(String msg,Object obj,Object ext){
        return new CommonResult(
                ResultCode.ERROR_CODE,
                msg,
                obj,
                ext
        );
    }

}
